package com.weberror.frontendmonitoring.whiteanomaly.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 白屏异常(Whiteanomaly)表实体类
 *
 * @author cnxym
 * @since 2022-08-17 20:06:24
 */
@TableName(value = "whiteanomaly")
public class Whiteanomaly {
    //白屏异常id
    @TableId(value = "whiteanomaly_id", type= IdType.AUTO)
    private Integer whiteanomalyId;
    //错误类型
    @TableField(value = "whiteanomaly_errortype")
    private String whiteanomalyErrortype;
    //上报类型
    @TableField(value = "whiteanomaly_type")
    private String whiteanomalyType;
    //产生错误时间
    @TableField(value = "whiteanomaly_time")
    private String whiteanomalyTime;


    public Integer getWhiteanomalyId() {
        return whiteanomalyId;
    }

    public void setWhiteanomalyId(Integer whiteanomalyId) {
        this.whiteanomalyId = whiteanomalyId;
    }

    public String getWhiteanomalyErrortype() {
        return whiteanomalyErrortype;
    }

    public void setWhiteanomalyErrortype(String whiteanomalyErrortype) {
        this.whiteanomalyErrortype = whiteanomalyErrortype;
    }

    public String getWhiteanomalyType() {
        return whiteanomalyType;
    }

    public void setWhiteanomalyType(String whiteanomalyType) {
        this.whiteanomalyType = whiteanomalyType;
    }

    public String getWhiteanomalyTime() {
        return whiteanomalyTime;
    }

    public void setWhiteanomalyTime(Object whiteanomalyTime) {
        if (whiteanomalyTime instanceof Date) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = (Date) whiteanomalyTime;
            this.whiteanomalyTime = dateFormat.format(date);
        } else if (whiteanomalyTime instanceof Long) {
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Date date = new Date((Long) whiteanomalyTime);
            this.whiteanomalyTime = dateFormat.format(date);
        }
    }

}

